\doxysection{stm32h7xx\+\_\+hal\+\_\+hsem.\+h}
\hypertarget{stm32h7xx__hal__hsem_8h_source}{}\label{stm32h7xx__hal__hsem_8h_source}\index{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/Drivers/STM32H7xx\_HAL\_Driver/Inc/stm32h7xx\_hal\_hsem.h@{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/Drivers/STM32H7xx\_HAL\_Driver/Inc/stm32h7xx\_hal\_hsem.h}}
\mbox{\hyperlink{stm32h7xx__hal__hsem_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ }
\DoxyCodeLine{00018\ }
\DoxyCodeLine{00019\ \textcolor{comment}{/*\ Define\ to\ prevent\ recursive\ inclusion\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#ifndef\ STM32H7xx\_HAL\_HSEM\_H}}
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#define\ STM32H7xx\_HAL\_HSEM\_H}}
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00023\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}}
\DoxyCodeLine{00024\ \textcolor{keyword}{extern}\ \textcolor{stringliteral}{"{}C"{}}\ \{}
\DoxyCodeLine{00025\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00027\ \textcolor{comment}{/*\ Includes\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{00028\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{stm32h7xx__hal__def_8h}{stm32h7xx\_hal\_def.h}}"{}}}
\DoxyCodeLine{00029\ }
\DoxyCodeLine{00033\ }
\DoxyCodeLine{00037\ }
\DoxyCodeLine{00038\ \textcolor{comment}{/*\ Exported\ macro\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{00042\ }
\DoxyCodeLine{00048\ \textcolor{preprocessor}{\#define\ \_\_HAL\_HSEM\_SEMID\_TO\_MASK(\_\_SEMID\_\_)\ (1\ <<\ (\_\_SEMID\_\_))}}
\DoxyCodeLine{00049\ }
\DoxyCodeLine{00055\ \textcolor{preprocessor}{\#if\ defined(DUAL\_CORE)}}
\DoxyCodeLine{00056\ \textcolor{preprocessor}{\#define\ \_\_HAL\_HSEM\_ENABLE\_IT(\_\_SEM\_MASK\_\_)\ ((((SCB-\/>CPUID\ \&\ 0x000000F0)\ >>\ 4\ )==\ 0x7)\ ?\ \(\backslash\)}}
\DoxyCodeLine{00057\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (HSEM-\/>C1IER\ |=\ (\_\_SEM\_MASK\_\_))\ :\ \(\backslash\)}}
\DoxyCodeLine{00058\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (HSEM-\/>C2IER\ |=\ (\_\_SEM\_MASK\_\_)))}}
\DoxyCodeLine{00059\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00060\ \textcolor{preprocessor}{\#define\ \_\_HAL\_HSEM\_ENABLE\_IT(\_\_SEM\_MASK\_\_)\ (HSEM-\/>C1IER\ |=\ (\_\_SEM\_MASK\_\_))}}
\DoxyCodeLine{00061\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{/*\ DUAL\_CORE\ */}\textcolor{preprocessor}{}\textcolor{preprocessor}{}}
\DoxyCodeLine{00067\ \textcolor{preprocessor}{\#if\ defined(DUAL\_CORE)}}
\DoxyCodeLine{00068\ \textcolor{preprocessor}{\#define\ \_\_HAL\_HSEM\_DISABLE\_IT(\_\_SEM\_MASK\_\_)\ ((((SCB-\/>CPUID\ \&\ 0x000000F0)\ >>\ 4\ )==\ 0x7)\ ?\ \(\backslash\)}}
\DoxyCodeLine{00069\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (HSEM-\/>C1IER\ \&=\ \string~(\_\_SEM\_MASK\_\_))\ :\ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00070\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (HSEM-\/>C2IER\ \&=\ \string~(\_\_SEM\_MASK\_\_)))}}
\DoxyCodeLine{00071\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00072\ \textcolor{preprocessor}{\#define\ \_\_HAL\_HSEM\_DISABLE\_IT(\_\_SEM\_MASK\_\_)\ (HSEM-\/>C1IER\ \&=\ \string~(\_\_SEM\_MASK\_\_))}}
\DoxyCodeLine{00073\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{/*\ DUAL\_CORE\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00074\ }
\DoxyCodeLine{00080\ \textcolor{preprocessor}{\#if\ defined(DUAL\_CORE)}}
\DoxyCodeLine{00081\ \textcolor{preprocessor}{\#define\ \_\_HAL\_HSEM\_GET\_IT(\_\_SEM\_MASK\_\_)\ ((((SCB-\/>CPUID\ \&\ 0x000000F0)\ >>\ 4\ )==\ 0x7)\ ?\ \(\backslash\)}}
\DoxyCodeLine{00082\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ((\_\_SEM\_MASK\_\_)\ \&\ HSEM-\/>C1MISR)\ :\ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00083\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ((\_\_SEM\_MASK\_\_)\ \&\ HSEM-\/>C2MISR))}}
\DoxyCodeLine{00084\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00085\ \textcolor{preprocessor}{\#define\ \_\_HAL\_HSEM\_GET\_IT(\_\_SEM\_MASK\_\_)\ ((\_\_SEM\_MASK\_\_)\ \&\ HSEM-\/>C1MISR)}}
\DoxyCodeLine{00086\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{/*\ DUAL\_CORE\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00087\ }
\DoxyCodeLine{00093\ \textcolor{preprocessor}{\#if\ defined(DUAL\_CORE)}}
\DoxyCodeLine{00094\ \textcolor{preprocessor}{\#define\ \_\_HAL\_HSEM\_GET\_FLAG(\_\_SEM\_MASK\_\_)\ ((((SCB-\/>CPUID\ \&\ 0x000000F0)\ >>\ 4\ )==\ 0x7)\ ?\ \(\backslash\)}}
\DoxyCodeLine{00095\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\_\_SEM\_MASK\_\_)\ \&\ HSEM-\/>C1ISR\ :\ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00096\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\_\_SEM\_MASK\_\_)\ \&\ HSEM-\/>C2ISR)}}
\DoxyCodeLine{00097\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00098\ \textcolor{preprocessor}{\#define\ \_\_HAL\_HSEM\_GET\_FLAG(\_\_SEM\_MASK\_\_)\ ((\_\_SEM\_MASK\_\_)\ \&\ HSEM-\/>C1ISR)}}
\DoxyCodeLine{00099\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{/*\ DUAL\_CORE\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00100\ }
\DoxyCodeLine{00106\ \textcolor{preprocessor}{\#if\ defined(DUAL\_CORE)}}
\DoxyCodeLine{00107\ \textcolor{preprocessor}{\#define\ \_\_HAL\_HSEM\_CLEAR\_FLAG(\_\_SEM\_MASK\_\_)\ ((((SCB-\/>CPUID\ \&\ 0x000000F0)\ >>\ 4\ )==\ 0x7)\ ?\ \(\backslash\)}}
\DoxyCodeLine{00108\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (HSEM-\/>C1ICR\ |=\ (\_\_SEM\_MASK\_\_))\ :\ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00109\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (HSEM-\/>C2ICR\ |=\ (\_\_SEM\_MASK\_\_)))}}
\DoxyCodeLine{00110\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00111\ \textcolor{preprocessor}{\#define\ \_\_HAL\_HSEM\_CLEAR\_FLAG(\_\_SEM\_MASK\_\_)\ (HSEM-\/>C1ICR\ |=\ (\_\_SEM\_MASK\_\_))}}
\DoxyCodeLine{00112\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{/*\ DUAL\_CORE\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00113\ }
\DoxyCodeLine{00117\ }
\DoxyCodeLine{00118\ \textcolor{comment}{/*\ Exported\ functions\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{00122\ }
\DoxyCodeLine{00127\ }
\DoxyCodeLine{00128\ \textcolor{comment}{/*\ HSEM\ semaphore\ take\ (lock)\ using\ 2-\/Step\ \ method\ ****************************/}}
\DoxyCodeLine{00129\ \mbox{\hyperlink{stm32h7xx__hal__def_8h_a63c0679d1cb8b8c684fbb0632743478f}{HAL\_StatusTypeDef}}\ \ HAL\_HSEM\_Take(uint32\_t\ SemID,\ uint32\_t\ ProcessID);}
\DoxyCodeLine{00130\ \textcolor{comment}{/*\ HSEM\ semaphore\ fast\ take\ (lock)\ using\ 1-\/Step\ \ method\ ***********************/}}
\DoxyCodeLine{00131\ \mbox{\hyperlink{stm32h7xx__hal__def_8h_a63c0679d1cb8b8c684fbb0632743478f}{HAL\_StatusTypeDef}}\ \ HAL\_HSEM\_FastTake(uint32\_t\ SemID);}
\DoxyCodeLine{00132\ \textcolor{comment}{/*\ HSEM\ Release\ \ **************************************************************/}}
\DoxyCodeLine{00133\ \textcolor{keywordtype}{void}\ \ HAL\_HSEM\_Release(uint32\_t\ SemID,\ uint32\_t\ ProcessID);}
\DoxyCodeLine{00134\ \textcolor{comment}{/*\ HSEM\ Release\ All************************************************************/}}
\DoxyCodeLine{00135\ \textcolor{keywordtype}{void}\ HAL\_HSEM\_ReleaseAll(uint32\_t\ Key,\ uint32\_t\ CoreID);}
\DoxyCodeLine{00136\ \textcolor{comment}{/*\ HSEM\ Check\ semaphore\ state\ Taken\ or\ not\ \ \ **********************************/}}
\DoxyCodeLine{00137\ uint32\_t\ HAL\_HSEM\_IsSemTaken(uint32\_t\ SemID);}
\DoxyCodeLine{00138\ }
\DoxyCodeLine{00142\ }
\DoxyCodeLine{00147\ \textcolor{comment}{/*\ HSEM\ Set\ Clear\ Key\ *********************************************************/}}
\DoxyCodeLine{00148\ \textcolor{keywordtype}{void}\ \ HAL\_HSEM\_SetClearKey(uint32\_t\ Key);}
\DoxyCodeLine{00149\ \textcolor{comment}{/*\ HSEM\ Get\ Clear\ Key\ *********************************************************/}}
\DoxyCodeLine{00150\ uint32\_t\ HAL\_HSEM\_GetClearKey(\textcolor{keywordtype}{void});}
\DoxyCodeLine{00154\ }
\DoxyCodeLine{00159\ \textcolor{comment}{/*\ HSEM\ Activate\ HSEM\ Notification\ (When\ a\ semaphore\ is\ released)\ )\ *****************/}}
\DoxyCodeLine{00160\ \textcolor{keywordtype}{void}\ HAL\_HSEM\_ActivateNotification(uint32\_t\ SemMask);}
\DoxyCodeLine{00161\ \textcolor{comment}{/*\ HSEM\ Deactivate\ HSEM\ Notification\ (When\ a\ semaphore\ is\ released)\ \ ****************/}}
\DoxyCodeLine{00162\ \textcolor{keywordtype}{void}\ HAL\_HSEM\_DeactivateNotification(uint32\_t\ SemMask);}
\DoxyCodeLine{00163\ \textcolor{comment}{/*\ HSEM\ Free\ Callback\ (When\ a\ semaphore\ is\ released)\ \ *******************************/}}
\DoxyCodeLine{00164\ \textcolor{keywordtype}{void}\ HAL\_HSEM\_FreeCallback(uint32\_t\ SemMask);}
\DoxyCodeLine{00165\ \textcolor{comment}{/*\ HSEM\ IRQ\ Handler\ \ **********************************************************/}}
\DoxyCodeLine{00166\ \textcolor{keywordtype}{void}\ HAL\_HSEM\_IRQHandler(\textcolor{keywordtype}{void});}
\DoxyCodeLine{00167\ }
\DoxyCodeLine{00171\ }
\DoxyCodeLine{00175\ }
\DoxyCodeLine{00176\ \textcolor{comment}{/*\ Private\ macros\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{00180\ }
\DoxyCodeLine{00181\ \textcolor{preprocessor}{\#define\ IS\_HSEM\_SEMID(\_\_SEMID\_\_)\ ((\_\_SEMID\_\_)\ <=\ HSEM\_SEMID\_MAX\ )}}
\DoxyCodeLine{00182\ }
\DoxyCodeLine{00183\ \textcolor{preprocessor}{\#define\ IS\_HSEM\_PROCESSID(\_\_PROCESSID\_\_)\ ((\_\_PROCESSID\_\_)\ <=\ HSEM\_PROCESSID\_MAX\ )}}
\DoxyCodeLine{00184\ }
\DoxyCodeLine{00185\ \textcolor{preprocessor}{\#define\ IS\_HSEM\_KEY(\_\_KEY\_\_)\ ((\_\_KEY\_\_)\ <=\ HSEM\_CLEAR\_KEY\_MAX\ )}}
\DoxyCodeLine{00186\ }
\DoxyCodeLine{00187\ \textcolor{preprocessor}{\#if\ defined(DUAL\_CORE)}}
\DoxyCodeLine{00188\ \textcolor{preprocessor}{\#define\ IS\_HSEM\_COREID(\_\_COREID\_\_)\ (((\_\_COREID\_\_)\ ==\ HSEM\_CPU1\_COREID)\ ||\ \(\backslash\)}}
\DoxyCodeLine{00189\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ((\_\_COREID\_\_)\ ==\ HSEM\_CPU2\_COREID))}}
\DoxyCodeLine{00190\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00191\ \textcolor{preprocessor}{\#define\ IS\_HSEM\_COREID(\_\_COREID\_\_)\ ((\_\_COREID\_\_)\ ==\ HSEM\_CPU1\_COREID)}}
\DoxyCodeLine{00192\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00193\ }
\DoxyCodeLine{00194\ }
\DoxyCodeLine{00198\ }
\DoxyCodeLine{00202\ }
\DoxyCodeLine{00206\ }
\DoxyCodeLine{00207\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}}
\DoxyCodeLine{00208\ \}}
\DoxyCodeLine{00209\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00210\ }
\DoxyCodeLine{00211\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{/*\ STM32H7xx\_HAL\_HSEM\_H\ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
